package com.jl.smartcard.ui.preferences;

import org.eclipse.jface.preference.IPreferenceStore;

import com.jl.smartcard.ui.ActivatorUI;

public class SmartCardPref {
	
	private static IPreferenceStore store = ActivatorUI.getDefault().getPreferenceStore();
	
	/**
	 * get the preference of search range,like ["default","0x0000-0xffff"]; 
	 * @return
	 */
	public static String[] getSearchRange(){
		String range = store
				.getString(SmartcardPrefConstants.P_CHOICE_SEARCH_RANGE);
		if (range.equals("all")) {
			return new String[]{"0x0000-0xFFFF"};
		} else if (range.equals("input")) {
			String strValue = store
					.getString(SmartcardPrefConstants.P_STRING_INPUT_RANGE);
			String[] strs = strValue.split(",");
			return strs;
		} else {
			return new String[]{"default"};
		}
	}
}
